Page 79 - 2629_Devagiri_C-8
P. 79

The ALTER TABLE statement allows you to modify the structure of an existing table, such as
                                                     add, modify or delete column.




                 DELETING A TABLE
                 To delete a table in MySQL, you can use the DROP TABLE command. This command permanently

                 removes the table and all its data.
                 The syntax of DROP TABLE command is as follows:

                 DROP TABLE table_name;






                     The DROP TABLE command is permanent. There is no way to recover the table once it is deleted
                                                      unless you have a backup.






                        INSERTING DATA INTO TABLES


                 After creating a table, you can add records using the INSERT command. There are two ways to
                 insert data into a table.

                 INSERTING DATA TO ALL COLUMN

                 To insert a record into every column of a table, specify a value for each column in the same order
                 as the table’s definition.
                 The syntax to insert data to all columns is as follows:

                 INSERT INTO table_name VALUES

                 (value1, value2, value3, ...);
                 The command to insert data into all columns of a table is as follows:






















                                                                                                                  77
                                                                                          MySQL: My First Database
   74   75   76   77   78   79   80   81   82   83   84